Fix problem where menmonic wasn't removed properly when setting a label
authorOwen Taylor <otaylor@redhat.com>
Wed, 26 Sep 2001 20:33:23 +0000 (20:33 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 26 Sep 2001 20:33:23 +0000 (20:33 +0000)
Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>

* gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
problem where menmonic wasn't removed properly when
setting a label when there already is a label.
Also, handle setting the tab label back to the same
value. (#61160, #61161)

* gtk/gtkentry.c (paste_received): Patch from
        Damian Ivereigh to replace selection if there is
one. (#61121)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c
gtk/gtknotebook.c

index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 38b84931cbf81046af2a6664eb8cbe5591608f4e..4607887e7420b2a931ed81c89ccfee9bf12b70e0 100644 (file)
@@ -1,3 +1,15 @@
+Wed Sep 26 16:15:25 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
+       problem where menmonic wasn't removed properly when
+       setting a label when there already is a label.
+       Also, handle setting the tab label back to the same
+       value. (#61160, #61161)
+
+       * gtk/gtkentry.c (paste_received): Patch from 
+        Damian Ivereigh to replace selection if there is 
+       one. (#61121)
+       
 2001-09-25  Darin Adler  <darin@bentspoon.com>
 
        * tests/.cvsignore: Ignore new test program.
index 0554f001f4b030015d39e1fe6c988f085bdbeabf..d95f27c677a611dfdcc2f4ee9709f773a0914db5 100644 (file)
@@ -3127,8 +3127,12 @@ paste_received (GtkClipboard *clipboard,
       
   if (text)
     {
-      gint pos = entry->current_pos;
+      gint pos, start, end;
       
+      if (gtk_editable_get_selection_bounds (editable, &start, &end))
+        gtk_editable_delete_text (editable, start, end);
+
+      pos = entry->current_pos;
       gtk_editable_insert_text (editable, text, -1, &pos);
       gtk_editable_set_position (editable, pos);
     }
index a02551d5c7d7d0a32008e948230f5bccc821b474..53020ea79cbaee66508e9312d4c00c3589e9aa5b 100644 (file)
@@ -2053,6 +2053,20 @@ gtk_notebook_find_child (GtkNotebook *notebook,
   return list;
 }
 
+static void
+gtk_notebook_remove_tab_label (GtkNotebook     *notebook,
+                              GtkNotebookPage *page)
+{
+  if (page->tab_label)
+    {
+      if (page->mnemonic_activate_signal)
+       gtk_signal_disconnect (page->tab_label,
+                              page->mnemonic_activate_signal);
+
+      gtk_widget_unparent (page->tab_label);
+    }
+}
+
 static void
 gtk_notebook_real_remove (GtkNotebook *notebook,
                          GList       *list)
@@ -2082,15 +2096,10 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
   if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook))
     need_resize = TRUE;
 
-  if (page->tab_label && page->mnemonic_activate_signal)
-    gtk_signal_disconnect (page->tab_label,
-                          page->mnemonic_activate_signal);
-
   gtk_widget_unparent (page->child);
 
-  if (page->tab_label)
-    gtk_widget_unparent (page->tab_label);
-
+  gtk_notebook_remove_tab_label (notebook, page);
+  
   if (notebook->menu)
     {
       gtk_container_remove (GTK_CONTAINER (notebook->menu), 
@@ -4496,9 +4505,12 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook,
    * we need to set the associated label
    */
   page = list->data;
-  if (page->tab_label)
-    gtk_widget_unparent (page->tab_label);
-
+  
+  if (page->tab_label == tab_label)
+    return;
+  
+  gtk_notebook_remove_tab_label (notebook, page);
+  
   if (tab_label)
     {
       page->default_tab = FALSE;